package summer.codegenerator.model.base.duplicate;

import com.alibaba.fastjson.JSONObject;
import summer.codegenerator.model.base.Duplicate;

import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        People tim = new People("tim", Arrays.asList("tom", "timo", "timblak"),null, null, null);
        final Car tesla = new Car("silver", tim);
        final Car honda = new Car("black", tim);
        final Car toyota = new Car("blue", tim);
        tim.setCarList(Arrays.asList(tesla, honda, toyota));
        tim.setCarSet(new HashSet<Car>() {{
            this.add(tesla);
            this.add(honda);
            this.add(toyota);
        }});
        tim.setCarMap(new HashMap<String, Car>() {{
            this.put("tesla", tesla);
            this.put("honda", honda);
            this.put("toyota", toyota);
        }});
        System.out.println(JSONObject.toJSONString(Duplicate.dp(tim), true));
        System.out.println(JSONObject.toJSONString(Duplicate.dp(tesla), true));
    }
}
